<%--@elvariable id="page" type="util.Page"--%>
<%--
  Created by IntelliJ IDEA.
  User: 刘冉
  Date: 2024/10/14
  Time: 15:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <style>
        /*table{
           !* width: 800px !important;
            margin: 0 auto !important;*!
            width: 800px ;
            margin: 0 auto ;
        }
        p{
            text-align: center;
        }
        .layui-form-item{
            text-align: center;
        }*/
    </style>
</head>
<body>
<p>
    <form  action="/student/list/1" method="post">
        <div class="layui-form-item">
            <div class="layui-inline">
               <%-- <label class="layui-form-label">姓名</label>--%>
                <div class="layui-input-inline layui-input-wrap">
                    <input type="text" placeholder="请输入学号" name="studentNum" value="${condition.studentNum}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
                </div>
                <div class="layui-input-inline layui-input-wrap">
                    <input type="text" placeholder="请输入姓名" name="studentName" value="${condition.studentName}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
                </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入性别（0:男 1:女 2:保密）" name="gender" value="${condition.gender}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入年龄" name="age" value="${condition.age}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入出生日期" name="birthday" value="${condition.birthday}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入班级编号" name="classId" value="${condition.classId}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入宿舍编号" name="hostelId" value="${condition.hostelId}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入联系方式" name="phone" value="${condition.phone}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入邮箱" name="email" value="${condition.email}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入家庭住址" name="homeAddress" value="${condition.homeAddress}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入紧急联系人" name="emergencyContact" value="${condition.emergencyContact}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入紧急联系电话" name="emergencyContactPhone" value="${condition.emergencyContactPhone}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入专业" name="major" value="${condition.major}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入学生状态（0：在读，1：毕业）" name="status" value="${condition.status}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入删除标记（0：存在，1：删除）" name="delFlag" value="${condition.delFlag}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入创建人" name="createBy" value="${condition.createBy}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入创建时间" name="createTime" value="${condition.createTime}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入更新人" name="updateBy" value="${condition.updateBy}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入更新时间" name="updateTime" value="${condition.updateTime}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
               <div class="layui-input-inline layui-input-wrap">
                   <input type="text" placeholder="请输入备注" name="remark" value="${condition.remark}" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
               </div>
                <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">搜索</button>
                <a class="layui-btn layui-bg-blue" href="/student/toadd">新增学生</a>
            </div>
        </div>
    </form>
</p>

    <table class="layui-table" lay-even>
        <colgroup>
            <col width="150">
            <col width="150">
            <col>
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>学生编号</th>
            <th>学号</th>
            <th>姓名</th>
            <th>性别（0:男 1:女 2:保密）</th>
            <th>年龄</th>
            <th>出生日期</th>
            <th>班级编号</th>
            <th>宿舍编号</th>
            <th>联系方式</th>
            <th>邮箱</th>
            <th>家庭住址</th>
            <th>紧急联系人</th>
            <th>紧急联系电话</th>
            <th>专业</th>
            <th>学生状态（0：在读，1：毕业）</th>
            <th>删除标记（0：存在，1：删除）</th>
            <th>创建人</th>
            <th>创建时间</th>
            <th>更新人</th>
            <th>更新时间</th>
            <th>备注</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${students}" var="student">
            <tr>
                <td>${student.sId}</td>
                <td>${student.studentNum}</td>
                <td>${student.studentName}</td>
                <td>${student.gender}</td>
                <td>${student.age}</td>
                <td><fmt:formatDate value="${student.birthday}"></fmt:formatDate></td>
                <td>${student.classId}</td>
                <td>${student.hostelId}</td>
                <td>${student.phone}</td>
                <td>${student.email}</td>
                <td>${student.homeAddress}</td>
                <td>${student.emergencyContact}</td>
                <td>${student.emergencyContactPhone}</td>
                <td>${student.major}</td>
                <td>${student.status}</td>
                <td>${student.delFlag}</td>
                <td>${student.createBy}</td>
                <td><fmt:formatDate value="${student.createTime}"></fmt:formatDate></td>
                <td>${student.updateBy}</td>
                <td><fmt:formatDate value="${student.updateTime}"></fmt:formatDate></td>
                <td>${student.remark}</td>
                <td>
                    <a href="/student/toupdate/${student.sId}">修改</a>
                    <a href="/student/delete/${student.sId}">删除</a>
                </td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="4">
                <a href="/student/list/1">首页</a>
                <c:if test="${page.currentPage!=1}">
                     <a href="/student/list/${page.currentPage-1}">上一页</a>
                </c:if>
                &nbsp;第${page.currentPage}页/总${page.totalPage}页&nbsp;
                <c:if test="${page.currentPage!=page.totalPage}">
                    <a href="/student/list/${page.currentPage+1}">下一页</a>
                </c:if>
                <a href="/student/list/${page.totalPage}">末页</a>
        </tr>
        </tbody>
    </table>
</body>
</html>
